//邮箱正则表达式
const emailRegex: RegExp = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;

//匹配账号的正则
const accountRegex: RegExp = /^[a-zA-Z0-9_]{10,16}$/;

//匹配密码的正则
const passwordRegex: RegExp = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,16}$/;

function validateEmail(email: string): boolean {
    return emailRegex.test(email);
}

function validateAccount(account: string): boolean {
    return accountRegex.test(account);
}

function validatePassword(password: string): boolean {
    return passwordRegex.test(password);
}

export { validateEmail, validateAccount, validatePassword };